<template>
    <div>
        动态style:
        语法：:style="{csss属性名： 值}"
    </div>
    <p :style="{ color: color }">动态style</p>
    <p :style="{ color: color,backgroundColor:bgcolor }">动态style</p>
    <p :style = "styleObj">动态style</p>
</template>

<script setup>
import { ref } from 'vue';

const color = ref('red');
const bgcolor = ref('skyblue');
const styleObj = ref({
    color: 'red',
    backgroundColor: 'skyblue'
});
</script>

<style scoped>

</style>